import Vue from 'vue'
import App from './App.vue'
import router from './router'
// import { getToken } from '@/utils/storage'
import { Toast } from 'vant'
import { Form } from 'vant'
import { Field } from 'vant'
import { Button } from 'vant'
import { NavBar } from 'vant'
import { Tabbar, TabbarItem } from 'vant'
import { Image as VanImage } from 'vant'
import { Grid, GridItem } from 'vant'
import { Swipe, SwipeItem } from 'vant'
import { Lazyload } from 'vant'
import { Icon } from 'vant'
import { Cell, CellGroup } from 'vant'
import { List } from 'vant'
import { Empty } from 'vant';
import { Search } from 'vant';
import { DropdownMenu, DropdownItem } from 'vant';
import { Dialog } from 'vant';
import { IndexBar, IndexAnchor } from 'vant';
import { Popup } from 'vant';
import { Uploader } from 'vant';
import { Area } from 'vant';
import { Picker } from 'vant';
import { Divider } from 'vant';
import { Col, Row } from 'vant';

Vue.use(Col);
Vue.use(Row);
Vue.use(Divider);
Vue.use(Picker);
Vue.use(Area);
Vue.use(Uploader);
Vue.use(Popup)
Vue.use(IndexBar);
Vue.use(IndexAnchor);
Vue.use(Dialog);
Vue.use(DropdownMenu);
Vue.use(DropdownItem);
Vue.use(Search);
Vue.use(Empty);
Vue.use(List)
Vue.use(Cell)
Vue.use(CellGroup)
Vue.use(Icon)
Vue.use(Lazyload)
Vue.use(Swipe)
Vue.use(SwipeItem)
Vue.use(Grid)
Vue.use(GridItem)
Vue.use(VanImage)
Vue.use(Tabbar)
Vue.use(TabbarItem)
Vue.use(NavBar)
Vue.use(Button)
Vue.use(Form)
Vue.use(Field)
Vue.use(Toast)

Vue.config.productionTip = false

import BaiduMap from 'vue-baidu-map'

Vue.use(BaiduMap, {
  // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
  ak: 'nYkVt1Uji991GAjXhbmEjvebrPI3v2Ss'
})

//全局路由守卫
// const whiteRouter = ['/login', '/register', '/layout', '/user'] // 白名单
// router.beforeEach((to, from, next) => {
//   const token = getToken()
//   if (token) {
//     next()
//   } else {
//     if (whiteRouter.includes(to.path)) {
//       next()
//     } else {
//       next('/login')
//     }
//   }
// })

new Vue({
  router,
  render: (h) => h(App)
}).$mount('#app')
